<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src ="js/jquery-1.10.2.min.js"></script>
<title>新用户注册</title>
<script type="text/javascript">
	var xmlHttp=null;
	function checkLoginName(obj){
		var loginName=obj.value;
		console.log(loginName);
		//如果用户名为空字符串,则不发出异步请求
		if(loginName.trim().length==0){
			return;
		}
		
		$.ajax({
			url:"getAjax",
			type:"POST",	
			data:"loginName="+loginName,
			success:function(result){
				document.getElementById("msg").innerHTML=result;
			}
		});
	}

</script>
</head>
<body>
	<form >
		账号         :<input type="text" name="loginName" onblur="checkLoginName(this);">
				<span id="msg"></span><br>			
		密码         :<input type="password" name="pwd"><br>
		确认密码 :<input type="password"> 
		<input type="submit"value="注册">
	</form>
</body>
</html>